package com.resource.project.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.resource.project.entity.RespBean;
import com.resource.project.entity.TResourcePlan;
import com.resource.project.service.ITResourcePlanService;
import com.resource.util.page.PageParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 领料计划表 前端控制器
 * </p>
 *
 * @author resource
 * @since 2020-12-08
 */
@RestController
@RequestMapping("/project/t-resource-plan")
public class TResourcePlanController {
    @Autowired
    private ITResourcePlanService resourcePlanService;
    @ApiOperation(value = "领料/采购计划分页")
    @PostMapping
    public IPage<TResourcePlan> page(PageParam pageParam, @RequestBody TResourcePlan resource){
        return resourcePlanService.page(pageParam,resource);
    }

    @ApiOperation(value = "添加领料/采购计划")
    @PostMapping("/add")
    public RespBean add(@RequestBody TResourcePlan resource){
        return resourcePlanService.add(resource);
    }

    @ApiOperation(value = "修改")
    @PutMapping
    public RespBean update(@RequestBody TResourcePlan resource){
        return resourcePlanService.updateTResourcePlan(resource);
    }
}
